package com.cdtye.itps.cms.controller.tunnel;

import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.itps.cms.dao.tunnel.vo.JcTunnelVo;
import com.cdtye.itps.cms.service.tunnel.JcTunnelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 隧道 前端控制器
 * @author Jchen
 * @date 2021-07-08
 */
@Api(tags="隧道接口")
@RestController
@RequestMapping("/tunnel")
public class JcTunnelController {
    @Autowired
    private JcTunnelService modelService;

    /**
     * 隧道 列表
     * @param vo
     * @return
     */
    @ApiOperation("隧道列表")
    @GetMapping("/getList")
    AjaxJson getList(JcTunnelVo vo){
        return AjaxJson.success(modelService.getList(vo));
    }

    /**
     * 根据tunnelIdList获取隧道
     * @param vo
     * @return
     */
    @ApiOperation("根据tunnelIdList获取隧道")
    @GetMapping("/getByTunnelIdList")
    AjaxJson getByTunnelIdList(JcTunnelVo vo){
        return AjaxJson.success(modelService.getByTunnelIdList(vo));
    }


    /**
     * 根据tackerId获取隧道
     * @param tunnelId
     * @return
     */
    @ApiOperation("根据tunnelId获取隧道")
    @GetMapping("/getTunnelById")
    AjaxJson getTunnelById(String  tunnelId){
        return AjaxJson.success(modelService.getTunnelById(tunnelId));
    }
}
